package com.dingtalk.test;

import com.alibaba.fastjson.JSONObject;
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.JsonNode;
import com.mashape.unirest.http.Unirest;
import com.mashape.unirest.http.exceptions.UnirestException;

/**
 * @Title: getData
 * @Description: TODO
 * @Create 2022/11/23 16:12
 * @Author: Wang.Tonglin
 * @Contact: wang.tonglin@trs.com.cn
 * @Company: 成都拓尔思信息技术有限公司
 * @Department: 中台（Middle-End）
 */
public class GetData {
    public static void main(String[] args) throws UnirestException {
        HttpResponse<JsonNode> response = Unirest.get("http://192.168.43.129:9999/rest/api/2/issue/10000")
                .basicAuth("admin", "wtl199909")
                .header("Accept", "application/json")
                .asJson();
        JsonNode body = response.getBody();
        JSONObject jsonObject = JSONObject.parseObject(body.toString());
        System.err.println(jsonObject);
    }
}
